// BCFuglMeyerLowPage.cpp : implementation file
//

#include "stdafx.h"
#include "../Frame/GYWalkAidApp.h"
#include "BCFuglMeyerLowPage.h"
#include "../Common/CommonFun.h"
#include "../Common/GYDataSet.h"
#include "../Common/LinkComboBox.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBCFuglMeyerLowPage dialog

static INPUT_FIELD_INFO s_InputFieldArray1[] = 
{
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};

static INPUT_FIELD_INFO s_InputFieldArray2[] = 
{
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};

static INPUT_FIELD_INFO s_InputFieldArray3[] = 
{
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerLowPage::ScoreFieldsCheck,		CBCFuglMeyerLowPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	2,		NULL,										NULL	},
};

CBCFuglMeyerLowPage::CBCFuglMeyerLowPage(CWnd* pParent, BOOL bBigRes) : CScrollPage(bBigRes ? CBCFuglMeyerLowPage::IDD : CBCFuglMeyerLowPage::SD_IDD, pParent)
, m_edtFMLow101(&m_InputFieldArray1[0]),	m_edtFMLow201(&m_InputFieldArray2[0]),	m_edtFMLow301(&m_InputFieldArray3[0])
, m_edtFMLow102(&m_InputFieldArray1[1]),	m_edtFMLow202(&m_InputFieldArray2[1]),	m_edtFMLow302(&m_InputFieldArray3[1])
, m_edtFMLow103(&m_InputFieldArray1[2]),	m_edtFMLow203(&m_InputFieldArray2[2]),	m_edtFMLow303(&m_InputFieldArray3[2])
, m_edtFMLow104(&m_InputFieldArray1[3]),	m_edtFMLow204(&m_InputFieldArray2[3]),	m_edtFMLow304(&m_InputFieldArray3[3])
, m_edtFMLow105(&m_InputFieldArray1[4]),	m_edtFMLow205(&m_InputFieldArray2[4]),	m_edtFMLow305(&m_InputFieldArray3[4])
, m_edtFMLow106(&m_InputFieldArray1[5]),	m_edtFMLow206(&m_InputFieldArray2[5]),	m_edtFMLow306(&m_InputFieldArray3[5])
, m_edtFMLow107(&m_InputFieldArray1[6]),	m_edtFMLow207(&m_InputFieldArray2[6]),	m_edtFMLow307(&m_InputFieldArray3[6])
, m_edtFMLow108(&m_InputFieldArray1[7]),	m_edtFMLow208(&m_InputFieldArray2[7]),	m_edtFMLow308(&m_InputFieldArray3[7])
, m_edtFMLow109(&m_InputFieldArray1[8]),	m_edtFMLow209(&m_InputFieldArray2[8]),	m_edtFMLow309(&m_InputFieldArray3[8])
, m_edtFMLow110(&m_InputFieldArray1[9]),	m_edtFMLow210(&m_InputFieldArray2[9]),	m_edtFMLow310(&m_InputFieldArray3[9])
, m_edtFMLow111(&m_InputFieldArray1[10]),	m_edtFMLow211(&m_InputFieldArray2[10]),	m_edtFMLow311(&m_InputFieldArray3[10])
, m_edtFMLow112(&m_InputFieldArray1[11]),	m_edtFMLow212(&m_InputFieldArray2[11]),	m_edtFMLow312(&m_InputFieldArray3[11])
, m_edtFMLow113(&m_InputFieldArray1[12]),	m_edtFMLow213(&m_InputFieldArray2[12]),	m_edtFMLow313(&m_InputFieldArray3[12])
, m_edtFMLow114(&m_InputFieldArray1[13]),	m_edtFMLow214(&m_InputFieldArray2[13]),	m_edtFMLow314(&m_InputFieldArray3[13])
, m_edtFMLow115(&m_InputFieldArray1[14]),	m_edtFMLow215(&m_InputFieldArray2[14]),	m_edtFMLow315(&m_InputFieldArray3[14])
, m_edtFMLow116(&m_InputFieldArray1[15]),	m_edtFMLow216(&m_InputFieldArray2[15]),	m_edtFMLow316(&m_InputFieldArray3[15])
, m_edtFMLow117(&m_InputFieldArray1[16]),	m_edtFMLow217(&m_InputFieldArray2[16]),	m_edtFMLow317(&m_InputFieldArray3[16])
, m_edtFMLow118(&m_InputFieldArray1[17]),	m_edtFMLow218(&m_InputFieldArray2[17]),	m_edtFMLow318(&m_InputFieldArray3[17])
{
	//{{AFX_DATA_INIT(CBCFuglMeyerLowPage)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	
	LPVOID pCtrl = NULL;
	DWORD dwControlType = IBT_NoneType;
	for(int i = 0; i < INPUT_EDIT_CTRL_COUNT; i++)
	{
		pCtrl = m_InputFieldArray1[i].pLinkCtrl;
		dwControlType = m_InputFieldArray1[i].dwCtrlType;
		memcpy(&m_InputFieldArray1[i], &s_InputFieldArray1[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray1[i].pLinkCtrl = pCtrl;
		m_InputFieldArray1[i].dwCtrlType = dwControlType;
		
		pCtrl = m_InputFieldArray2[i].pLinkCtrl;
		dwControlType = m_InputFieldArray2[i].dwCtrlType;
		memcpy(&m_InputFieldArray2[i], &s_InputFieldArray2[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray2[i].pLinkCtrl = pCtrl;
		m_InputFieldArray2[i].dwCtrlType = dwControlType;
		
		pCtrl = m_InputFieldArray3[i].pLinkCtrl;
		dwControlType = m_InputFieldArray3[i].dwCtrlType;
		memcpy(&m_InputFieldArray3[i], &s_InputFieldArray3[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray3[i].pLinkCtrl = pCtrl;
		m_InputFieldArray3[i].dwCtrlType = dwControlType;
	}
}


void CBCFuglMeyerLowPage::DoDataExchange(CDataExchange* pDX)
{
	CScrollPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBCFuglMeyerLowPage)
	DDX_Control(pDX, IDC_EDIT_SCORE1,  m_edtFMLow101);
	DDX_Control(pDX, IDC_EDIT_SCORE46, m_edtFMLow102);
	DDX_Control(pDX, IDC_EDIT_SCORE49, m_edtFMLow103);
	DDX_Control(pDX, IDC_EDIT_SCORE52, m_edtFMLow104);
	DDX_Control(pDX, IDC_EDIT_SCORE55, m_edtFMLow105);
	DDX_Control(pDX, IDC_EDIT_SCORE58, m_edtFMLow106);
	DDX_Control(pDX, IDC_EDIT_SCORE61, m_edtFMLow107);
	DDX_Control(pDX, IDC_EDIT_SCORE64, m_edtFMLow108);
	DDX_Control(pDX, IDC_EDIT_SCORE67, m_edtFMLow109);
	DDX_Control(pDX, IDC_EDIT_SCORE70, m_edtFMLow110);
	DDX_Control(pDX, IDC_EDIT_SCORE73, m_edtFMLow111);
	DDX_Control(pDX, IDC_EDIT_SCORE76, m_edtFMLow112);
	DDX_Control(pDX, IDC_EDIT_SCORE79, m_edtFMLow113);
	DDX_Control(pDX, IDC_EDIT_SCORE82, m_edtFMLow114);
	DDX_Control(pDX, IDC_EDIT_SCORE85, m_edtFMLow115);
	DDX_Control(pDX, IDC_EDIT_SCORE88, m_edtFMLow116);
	DDX_Control(pDX, IDC_EDIT_SCORE91, m_edtFMLow117);
	DDX_Control(pDX, IDC_EDIT_SCORE142,m_edtFMLow118); 

	DDX_Control(pDX, IDC_EDIT_SCORE2,   m_edtFMLow201);
	DDX_Control(pDX, IDC_EDIT_SCORE47,  m_edtFMLow202);
	DDX_Control(pDX, IDC_EDIT_SCORE50,  m_edtFMLow203);
	DDX_Control(pDX, IDC_EDIT_SCORE53,  m_edtFMLow204);
	DDX_Control(pDX, IDC_EDIT_SCORE56,  m_edtFMLow205);
	DDX_Control(pDX, IDC_EDIT_SCORE59,  m_edtFMLow206);
	DDX_Control(pDX, IDC_EDIT_SCORE62,  m_edtFMLow207);
	DDX_Control(pDX, IDC_EDIT_SCORE65,  m_edtFMLow208);
	DDX_Control(pDX, IDC_EDIT_SCORE68,  m_edtFMLow209);
	DDX_Control(pDX, IDC_EDIT_SCORE71,  m_edtFMLow210);
	DDX_Control(pDX, IDC_EDIT_SCORE74,  m_edtFMLow211);
	DDX_Control(pDX, IDC_EDIT_SCORE77,  m_edtFMLow212);
	DDX_Control(pDX, IDC_EDIT_SCORE80,  m_edtFMLow213);
	DDX_Control(pDX, IDC_EDIT_SCORE83,  m_edtFMLow214);
	DDX_Control(pDX, IDC_EDIT_SCORE86,  m_edtFMLow215);
	DDX_Control(pDX, IDC_EDIT_SCORE89,  m_edtFMLow216);
	DDX_Control(pDX, IDC_EDIT_SCORE92,  m_edtFMLow217);
	DDX_Control(pDX, IDC_EDIT_SCORE143, m_edtFMLow218);
	
	DDX_Control(pDX, IDC_EDIT_SCORE3,   m_edtFMLow301);
	DDX_Control(pDX, IDC_EDIT_SCORE48,  m_edtFMLow302);
	DDX_Control(pDX, IDC_EDIT_SCORE51,  m_edtFMLow303);
	DDX_Control(pDX, IDC_EDIT_SCORE54,  m_edtFMLow304);
	DDX_Control(pDX, IDC_EDIT_SCORE57,  m_edtFMLow305);
	DDX_Control(pDX, IDC_EDIT_SCORE60,  m_edtFMLow306);
	DDX_Control(pDX, IDC_EDIT_SCORE63,  m_edtFMLow307);
	DDX_Control(pDX, IDC_EDIT_SCORE66,  m_edtFMLow308);
	DDX_Control(pDX, IDC_EDIT_SCORE69,  m_edtFMLow309);
	DDX_Control(pDX, IDC_EDIT_SCORE72,  m_edtFMLow310);
	DDX_Control(pDX, IDC_EDIT_SCORE75,  m_edtFMLow311);
	DDX_Control(pDX, IDC_EDIT_SCORE78,  m_edtFMLow312);
	DDX_Control(pDX, IDC_EDIT_SCORE81,  m_edtFMLow313);
	DDX_Control(pDX, IDC_EDIT_SCORE84,  m_edtFMLow314);
	DDX_Control(pDX, IDC_EDIT_SCORE87,  m_edtFMLow315);
	DDX_Control(pDX, IDC_EDIT_SCORE90,  m_edtFMLow316);
	DDX_Control(pDX, IDC_EDIT_SCORE93,  m_edtFMLow317);
	DDX_Control(pDX, IDC_EDIT_SCORE144, m_edtFMLow318);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBCFuglMeyerLowPage, CScrollPage)
	//{{AFX_MSG_MAP(CBCFuglMeyerLowPage)
	ON_WM_VSCROLL()
	ON_WM_SIZE()
	ON_WM_MOUSEWHEEL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBCFuglMeyerLowPage message handlers

void CBCFuglMeyerLowPage::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	//...
	
	CScrollPage::OnVScroll(nSBCode, nPos, pScrollBar);
}

void CBCFuglMeyerLowPage::OnSize(UINT nType, int cx, int cy) 
{
	CScrollPage::OnSize(nType, cx, cy);
	
	//...
}

BOOL CBCFuglMeyerLowPage::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) 
{
	//...
	
	return CScrollPage::OnMouseWheel(nFlags, zDelta, pt);
}

BOOL CBCFuglMeyerLowPage::ClearData()
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	CWnd* apDateLabel[3];
	apDateLabel[0] = GetDlgItem(IDC_STATIC_FML_DATE_1);
	apDateLabel[1] = GetDlgItem(IDC_STATIC_FML_DATE_2);
	apDateLabel[2] = GetDlgItem(IDC_STATIC_FML_DATE_3);
	
	CWnd* apDiagSNArray[3];
	apDiagSNArray[0] = GetDlgItem(IDC_STATIC_DIAGSN1);
	apDiagSNArray[1] = GetDlgItem(IDC_STATIC_DIAGSN2);
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	return PageClearData(ppCtrlArray, INPUT_EDIT_CTRL_COUNT, apDateLabel, apDiagSNArray, ARRAY_ELE_COUNT(apDateLabel));
}

int CBCFuglMeyerLowPage::SaveData(CString strMRN, int nDiagSN, BOOL bIsDraft)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	return PageSaveData(strMRN, nDiagSN, bIsDraft, BODYCHECKSCALEID, ppCtrlArray, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCFuglMeyerLowPage::ScoreFieldsCheck(LPVOID pParam)
{
	CBCFuglMeyerLowPage* pParent = NULL;
	INPUT_FIELD_INFO* pFieldInfo = (INPUT_FIELD_INFO*)pParam;
	
	if(pFieldInfo->dwCtrlType == IBT_EditBox)
	{
		CLinkEdit* pEdit = (CLinkEdit*)pFieldInfo->pLinkCtrl;
		if(pEdit)
			pParent = (CBCFuglMeyerLowPage*)pEdit->GetParent();
	}
	else if(pFieldInfo->dwCtrlType == IBT_ComboBox)
	{
		CLinkComboBox* pCombo = (CLinkComboBox*)pFieldInfo->pLinkCtrl;
		if(pCombo)
			pParent = (CBCFuglMeyerLowPage*)pCombo->GetParent();
	}
	else
	{
		ASSERT(FALSE);
	}
	
	if(pParent == NULL)
	{
		ASSERT(FALSE);
		return FALSE;
	}
	
	return PageScoreFieldsCheck(pParam, 0, 2, pParent->m_InputFieldArray3, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCFuglMeyerLowPage::ShowTableDataWithStartCol(CString strMRN, int nDiagSN, int nStartCol)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	CWnd* apDateLabel[3];
	apDateLabel[0] = GetDlgItem(IDC_STATIC_FML_DATE_1);
	apDateLabel[1] = GetDlgItem(IDC_STATIC_FML_DATE_2);
	apDateLabel[2] = GetDlgItem(IDC_STATIC_FML_DATE_3);
	
	CWnd* apDiagSNArray[3];
	apDiagSNArray[0] = GetDlgItem(IDC_STATIC_DIAGSN1);
	apDiagSNArray[1] = GetDlgItem(IDC_STATIC_DIAGSN2);
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	return PageShowTableData(strMRN, nDiagSN, BODYCHECKSCALEID, ppCtrlArray, INPUT_EDIT_CTRL_COUNT, apDateLabel, apDiagSNArray, nStartCol);
}

BOOL CBCFuglMeyerLowPage::ShowTableData(CString strMRN, int nDiagSN)
{
	return ShowTableDataWithStartCol(strMRN, nDiagSN, 2);
}

BOOL CBCFuglMeyerLowPage::SetLastColTitile(CString strDate, int nDiagSN)
{
	CWnd* apDateLabel[3] = {0};
	apDateLabel[2] = GetDlgItem(IDC_STATIC_FML_DATE_3);
	
	CString astrDate[3];
	astrDate[2] = strDate;
	
	CWnd* apDiagSNArray[3] = {0};
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	int anDiagSN[3] = {0};
	anDiagSN[2] = nDiagSN;
	
	return PageShowColTitle(apDateLabel, astrDate, apDiagSNArray, anDiagSN, ARRAY_ELE_COUNT(apDateLabel));
}

BOOL CBCFuglMeyerLowPage::EnableInputControls(BOOL bEnable)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	return PageEnableInputControls(bEnable, ppCtrlArray, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCFuglMeyerLowPage::IsPageCurDayBlank()
{
	return CScrollPage::PageIsAllInputBlank(m_InputFieldArray3, INPUT_EDIT_CTRL_COUNT);
}
